#include "TahunAkademik.h"

// KONSTRUKTOR
ThnAkademik CreateThnAkademik(int tAwal, int tAkhir) {
	ThnAkademik T;
	AWAL(T) = tAwal;
	AKHIR(T) = tAkhir;
	return T;
}

// PREDIKAT
bool IsThnAkademikValid(int tAwal, int tAkhir) {
	return (tAkhir - tAwal) == 1;
}

bool IsThnAkademikLT(ThnAkademik A, ThnAkademik B) {
	return AWAL(A) < AWAL(B);
}
bool IsThnAkademikEq(ThnAkademik A, ThnAkademik B) {
	return AWAL(A) == AWAL(B);
}

// OPERASI
char* ThnAkademikToChar(ThnAkademik A) {
	char buff[50];
	sprintf(buff, "%d-%d\0", AWAL(A), AKHIR(A));
	return buff;
}
